/* -----------------------------------------------------------------------
*
* Random test of Adventurer card.
* -----------------------------------------------------------------------
*/

#include <assert.h>
#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>



void testCard(struct gameState* gState);

int main()
{
	struct gamestate* gState = malloc(sizeof(struct gameState));
	testCard(gState);
	free(gState);

	return 0;
}

void testCard(gamestate* gState)
{
	srand(time(NULL));

	int numPlayer = 2;
	int prevCount = 0;

	int prevTreasure = 0;

	int finalTreasure = 0;

	int k[10] = { adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall };


	gState.whoseTurn = 0;
	gState.hand[0][0] = adventurer;
	gstate.handCount[0] = rand() % 49 + 1;
	prevCount = gstate.handCount[0];
	
	for (int i = 0; i < gstate.handCount[0]; ++i)
	{
		if (game->hand[0][i] == copper || game->hand[0][i] == silver || game->hand[0][i] == gold)
			prevTreasure++;
	}



	adventurer_effect(0, &gState, 0);

	for (int i = 0; i < gstate.handCount[0]; ++i)
	{
		if (game->hand[0][i] == copper || game->hand[0][i] == silver || game->hand[0][i] == gold)
			finalTreasure++;
	}


	if (prevTreasure == finalTreasure)
	{
		printf("Adventurer test succeeded!\n");
	}
	else
	{
		printf("Adventurer test failed.\n")
	}


	return;
}
